package com.jinyi.wwdeng.ui.main.adapter

import android.annotation.SuppressLint
import androidx.recyclerview.widget.RecyclerView
import com.jinyi.lib_baseadapter.BGARecyclerViewAdapter
import com.jinyi.lib_baseadapter.BGAViewHolderHelper
import com.jinyi.wwdeng.R
import org.json.JSONObject

/**
 * JinYiTest
 * @Author wwdeng
 * @CreateTime: 2024/4/24 14:42
 * @Annotation：还款明细适配器
 */
class CreditRepaymentLableAdapter(recyclerView: RecyclerView?) :
    BGARecyclerViewAdapter<JSONObject>(recyclerView, R.layout.item_credit_repayment_lable) {
    override fun setItemChildListener(helper: BGAViewHolderHelper, viewType: Int) {
        helper.setItemChildClickListener(R.id.itemLayout) //点击Item
    }

    @SuppressLint("SetTextI18n")
    override fun fillData(helper: BGAViewHolderHelper, position: Int, model: JSONObject) {
        val tvTitle = helper.getTextView(R.id.tvTitle)
        tvTitle.text = model.optString("showName")

        val tvValue = helper.getTextView(R.id.tvValue)
        tvValue.text = model.optString("showDetail")
    }
}